package cn.pb.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.pb.domin.PageBean;
import cn.pb.domin.QueryInfo;
import cn.pb.service.BlogService;
import cn.pb.utils.WebUtils;

@Controller
public class PageController {
	@Autowired
	public BlogService bs;

	@RequestMapping(value = "/")
	public String showIndex(HttpServletRequest request) {
		QueryInfo info = WebUtils.request2Bean(request, QueryInfo.class);
		PageBean pagebean = bs.pageQuery(info);
		request.setAttribute("pagebean", pagebean);
		return "/WEB-INF/page.jsp";
	}
}
